<template>
  <div class="carousel">
    <el-carousel height="200px">
      <el-carousel-item v-for="(item, index) in imgArr" :key="index">
        <img :src="item" alt="" />
      </el-carousel-item>
    </el-carousel>
  </div>
</template>

<script>
export default {
  //轮播图组件
  name: 'Carousel',
  data() {
    return {
      imgArr: [
        'https://www.yunliyunwai.cn/content_img/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210127162242_e18PsNg.jpg',
        'https://www.yunliyunwai.cn/content_img/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210127162242_e18PsNg.jpg'
      ]
    }
  }
}
</script>

<style scoped>
.carousel {
  width: 900px;
  border-radius: 20px;
}
</style>